ComponentOne Data Source for Entity Framework
C1.LiveLinq Namespace / LiveViewExtensions Class / LiveCount Method / LiveCount<T>(View<T>,Expression<Func<T,Boolean>>) Method
The type of the elements of source.
A view that contains elements to be tested and counted.
A function to test each element for a condition.

In This Topic
    LiveCount<T>(View<T>,Expression<Func<T,Boolean>>) Method
    In This Topic
    A view representing the number of elements of the specified view satisfying a condition.
    Syntax
    'Declaration
     
    
    Public Overloads Shared Function LiveCount(Of T)( _
       ByVal source As View(Of T), _
       ByVal predicate As System.Linq.Expressions.Expression(Of Func(Of T,Boolean)) _
    ) As AggregationView(Of T,Integer)
    public static AggregationView<T,int> LiveCount<T>( 
       View<T> source,
       System.Linq.Expressions.Expression<Func<T,bool>> predicate
    )

    Parameters

    source
    A view that contains elements to be tested and counted.
    predicate
    A function to test each element for a condition.

    Type Parameters

    T
    The type of the elements of source.
    Remarks
    It is possible to use standard LINQ query operator Count instead of LiveCount. Both are "live" in the sense that they are recomputed automatically when any change occurs in the source. The difference is that Count will every time loop through the entire source collection and aggregate it from scratch, whereas LiveCount will use a more performant algorithm, will maintain its value incrementally, processing only those source items that actually changed.
    See Also